package com.example.springbootmybatis.controller;

import com.example.springbootmybatis.entity.ECharsData;
import com.example.springbootmybatis.entity.ResultMap;
import com.example.springbootmybatis.service.ECharsDataService;
import com.example.springbootmybatis.util.ToolUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.List;

/**
 * 作者： Administrator
 * 日期: 2024/1/12/012
 * Description :
 */
@Slf4j
@CrossOrigin
@RequestMapping("/eChars")
@RestController
public class ECharsDataController {
    @Autowired
    ECharsDataService eCharsDataService;
    @RequestMapping("/getBaseData")
    public ResultMap getBaseData() throws ParseException {
        return ToolUtil.getResult( eCharsDataService.getECharsData(),"查询");
    }

    @RequestMapping("/getBorrowMonth")
    public ResultMap getBorrowMonth() throws ParseException {
        return ToolUtil.getResult( eCharsDataService.getBorrowMonth(),"查询");
    }

    @RequestMapping("/getReturnMonth")
    public ResultMap getReturnMonth() throws ParseException {
        return ToolUtil.getResult( eCharsDataService.getReturnMonth(),"查询");
    }
}
